//
//  R_Five_Good_TableViewCell.swift
//  MyFood
//
//  Created by dllo on 16/2/17.
//  Copyright © 2016年 XRG. All rights reserved.
//

import UIKit

protocol R_Five_Good_TableViewCellDelegate {

    func clickGoodTitle()
    func clickGoodImage(num :Int)
    func clickGoodUserHeadImg(num :Int)

    
}

class R_Five_Good_TableViewCell: UITableViewCell {
    var delegate : R_Five_Good_TableViewCellDelegate!

    @IBOutlet weak var titleBtn: UIButton!

    @IBAction func titleMoreClick(sender: AnyObject) {
        self.delegate.clickGoodTitle()
    }

    @IBOutlet weak var leftImg: UIImageView!

    @IBOutlet weak var midImg: UIImageView!

    @IBOutlet weak var rightImg: UIImageView!

    @IBOutlet weak var leftHead: UIImageView!

    @IBOutlet weak var rightHead: UIImageView!

    @IBOutlet weak var leftUserName: UILabel!

    @IBOutlet weak var midUserName: UILabel!

    @IBOutlet weak var midHead: UIImageView!
 
    @IBOutlet weak var rightUserName: UILabel!

    @IBOutlet weak var descLabel: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        let leftTap = UITapGestureRecognizer(target: self, action: "leftTap")
        leftImg.addGestureRecognizer(leftTap)

        let rightTap = UITapGestureRecognizer(target: self, action: "rightTap")
        rightImg.addGestureRecognizer(rightTap)

        let midTap = UITapGestureRecognizer(target: self, action: "midTap")
        midImg.addGestureRecognizer(midTap)

        let leftHeadTap = UITapGestureRecognizer(target: self, action: "leftHeadTap")
        leftHead.addGestureRecognizer(leftHeadTap)

        let rightHeadTap = UITapGestureRecognizer(target: self, action: "rightHeadTap")
        rightHead.addGestureRecognizer(rightHeadTap)

        let midHeadTap = UITapGestureRecognizer(target: self, action: "midHeadTap")
        midHead.addGestureRecognizer(midHeadTap)


    }

    func leftTap(){
        self.delegate.clickGoodImage(1)

    }

    func midTap(){
        self.delegate.clickGoodImage(4)

    }

    func rightTap(){
        self.delegate.clickGoodImage(7)

    }



    func leftHeadTap(){
        self.delegate.clickGoodUserHeadImg(2)

    }

    func midHeadTap(){
        self.delegate.clickGoodUserHeadImg(5)

    }

    func rightHeadTap(){
        self.delegate.clickGoodUserHeadImg(8)

    }




    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
